<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="d1" id="d1"></div>
    <span class="d1">span</span>
    <script>
 
        var d1 = document.getElementById('d1')
        var d2 = document.getElementsByClassName('d1')
        var d3 = document.getElementsByTagName('p')

        console.log(document.querySelector('#d1'))
        console.log(document.querySelector('.d1'))
        console.log(document.querySelector('p'))

        console.log(document.querySelector('.d1'))
        console.log(document.querySelector('p'))
        console.log(document.querySelector('#d1'))

    </script>
</body>

</html>